package com.sf.fy.uav.common.enums;

import lombok.Getter;

/**
 * @author ta136817
 */
@Getter
public enum UserCouponSourceEnum {
    /**
     * 优惠券定向发放来源枚举
     */
    ACTIVE_ACQUISITION("用户领取", 1),
    PASSIVE_ACQUISITION("定向发放", 2),
    REDEEM_CODE("兑换码", 3),
    NEWER("新人优惠券", 4);
    private String desc;
    private Integer value;

    public void setValue(Integer value) {
        this.value = value;
    }

    UserCouponSourceEnum(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }


    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (UserCouponSourceEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.getDesc();
            }
        }
        return null;
    }
}
